Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correctly configure R for BLAS/LAPACK & check configure output #1292

Merged
merged 2 commits into from
Nov 21, 2017

Conversation

boegel
Copy link
Member

@boegel boegel commented Nov 21, 2017

R is currently not being configured correctly, see easybuilders/easybuild-easyconfigs#1435 and also easybuilders/easybuild-easyconfigs#4773.

If LAPACK_LIBS is defined in preconfigopts, R reports that LAPACK is being built generic, which seems wrong (although it may be OK for LAPACK, since there are no tuned LAPACK libraries, all the tuning is done in the BLAS library afaik).

This change only defines $BLAS_LIBS in the environment, and checks the output of the configure command to make sure that BLAS/LAPACK is i) used, ii) correctly configured (i.e. no generic).

The R easyconfigs (in particular the recent easybuilders/easybuild-easyconfigs#5090 and easybuilders/easybuild-easyconfigs#5360) will need to be modified as well, since they now hard set LAPACK_LIBS via preconfigopts, which leads to LAPACK(generic) being reported.

That's a bit of a catch-22 situation though, since removing preconfigpts part and not including --with-blas --with-lapack in the easyconfig files requires that this updated easyblock is used, otherwise R gets (sliently) built without BLAS/LAPACK...

@boegel boegel added this to the 3.5.0 milestone Nov 21, 2017

# make sure correct config script is used for Tcl/Tk
for dep in ['Tcl', 'Tk']:
root = get_software_root(dep)
if root:
dep_config = os.path.join(root, 'lib', '%sConfig.sh' % dep.lower())
self.cfg.update('configopts', '-with-%s-config=%s' % (dep.lower(), dep_config))
self.cfg.update('configopts', '--with-%s-config=%s' % (dep.lower(), dep_config))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nasty typo here, this went undetected because the existing R easyconfigs already include --with-tcl-config and --with-tk-config in configopts...

# define $BLAS_LIBS to build R correctly against BLAS/LAPACK library
# $LAPACK_LIBS should *not* be specified since that may lead to using generic LAPACK
# see https://github.com/easybuilders/easybuild-easyconfigs/issues/1435
env.setvar('BLAS_LIBS', os.getenv('LIBBLAS_MT'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using $LIBBLAS_MT here, while existing R easyconfigs use $LIBBLAS.

This matter mainly when using Intel MKL, i.e. multithreaded vs sequential, see also the discussion in #202.

We could/should make this configurable, and stick to linking with the sequential BLAS library by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants